package ruletree.rule;

import org.jdom2.Element;

import components.Component;

public class Word {
	
	public static final String ROOT = "root";
	public static final String PREFIX = "prefix";
	public static final String SUFFIX = "suffix";
	public static final String NEWTRANS = "newTranslation";
	
	
	String root = null;
	String prefix = null;
	String suffix = null;
	String newTranslation = null;
	String currentForm  = null;
	
	public Word(String root){
		this.root = root;
	}
	
	public String getRoot() {
		return root;
	}
	public void setRoot(String root) {
		this.root = root;
	}
	public String getPrefix() {
		return prefix;
	}
	public void setPrefix(String prefix) {
		this.prefix = prefix;
	}
	public String getSuffix() {
		return suffix;
	}
	public void setSuffix(String suffix) {
		this.suffix = suffix;
	}
	public String getNewTranslation() {
		return newTranslation;
	}
	public void setNewTranslation(String newTranslation) {
		this.newTranslation = newTranslation;
	}
	
	public String getCurrentForm(){
		return currentForm;
	}
	
	public void setCurrentForm(String word){
		this.currentForm = word;
	}
	
	public Element generateXMLWord(){
		
		Element xmlElement = new Element("name");
		xmlElement.setAttribute(ROOT, root);
		
		if(prefix != null){
			xmlElement.setAttribute(PREFIX, prefix);
		}
		
		if(suffix != null){
			xmlElement.setAttribute(SUFFIX, suffix);
		}
		
		if(newTranslation != null){
			xmlElement.setAttribute(NEWTRANS, newTranslation);
		}
		
		return xmlElement;
	}
	
	

}
